package com.lovejes.cuniao.scheduling.datatransfer.dataputter;

import com.lovejes.cuniao.scheduling.exception.DataTransferException;


public class DataPutterFactory {

	static class SingletonHolder {
        static DataPutterFactory instance = new DataPutterFactory();
    }

    public static DataPutterFactory getInstance() {
        return SingletonHolder.instance;
    }
    
    public DataPutter getDataAdapterImpl(String className) throws DataTransferException {
    	DataPutter oDataPutter = null;
        try {
            Class<?> c = Class.forName(className);
            oDataPutter = (DataPutter) c.newInstance();
        } catch (Exception e) {
            throw new DataTransferException(e);
        }
        return oDataPutter;
    }
    
}
